
#include <boost/test/unit_test.hpp>

#include "HeaderFileFilter.h"
#include "SourceFileFilter.h"

BOOST_AUTO_TEST_SUITE(FileFilter)

BOOST_AUTO_TEST_CASE(acceptHeaderFileFilter)
{
	analyzer::HeaderFileFilter headerFileFilter;
	
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.h")));
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.hpp")));
	
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("./very\\ strange path/test.h")));
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("./very\\ strange path/test.hpp")));
	
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.h ")) == false);
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.hpp ")) == false);
	
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.c")) == false);
	BOOST_CHECK(headerFileFilter.acceptFile(std::string("test.cpp")) == false);
}

BOOST_AUTO_TEST_CASE(acceptSourceFileFilter)
{
	analyzer::SourceFileFilter sourceFileFilter;
	
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.c")));
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.cpp")));
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("./very\\ strange path/test.c")));
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("./very\\ strange path/test.cpp")));
	
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.c ")) == false);
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.cpp ")) == false);
	
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.h")) == false);
	BOOST_CHECK(sourceFileFilter.acceptFile(std::string("test.hpp")) == false);
}


BOOST_AUTO_TEST_SUITE_END()
